/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

/**
 * 财务管理 => 聚单客财务转账
 *  */
import React, { useMemo } from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import { connect } from 'umi';
import type { ConnectState } from '@/models/connect';
import { Tabs } from 'antd';
import styles from './index.less';
import KbTools from '@/components/_pages/Finance/jdkTransfer/tools';
import KbSearch from '@/components/_pages/Finance/jdkTransfer/search';

interface IndexType {
  winSize: string;
}

const TemplateAuditIndex = (props: IndexType) => {
  const { winSize } = props;
  const screenSize = useMemo(() => ['xs', 'sm'].includes(winSize), [winSize]);
  const tabList: any[] = useMemo(
    () => [
      {
        label: '转账工具',
        key: 'tools',
        children: <KbTools />,
      },
      {
        label: '转账查询',
        key: 'search',
        children: <KbSearch />,
      },
    ],
    [screenSize],
  );

  return (
    <PageContainer className={styles.main}>
      <Tabs items={tabList} />
    </PageContainer>
  );
};

export default connect(({ global }: ConnectState) => ({
  winSize: global.winSize || '',
}))(React.memo(TemplateAuditIndex));
